package com.freshdirect.src.model;


import javax.inject.Scope;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.stereotype.Component;

public class User {
    @NotEmpty(message = "Please enter your email addresss.")
    @Email(message = "Please enter a proper email addresss.")
    @Size(min = 1, max = 45 ,message = "")
    private String email;
    @NotEmpty(message = "Please enter your Username.")
    @Pattern(regexp = "^[a-zA-Z0-9._-]*$" , message = "Please enter a valid Username .")
    @Size(min = 1, max = 252 ,message = "")
     private String userName;
    @NotEmpty(message = "Please enter your Password.")
    @Pattern(regexp = "^[a-zA-Z0-9._-]*$" , message = "Please enter a valid Password .")
    @Size(min = 1, max = 25,message = "")
     private String password;
     @NotEmpty(message = "Please enter your Fullname.")
     @Pattern(regexp = "^[A-Za-z ,.'-]*$" , message = "Please enter valid name .")
    @Size(min = 1, max = 45,message = "")
     private String fullName;  
     @NotEmpty(message = "Please enter your Town.")
    @Size(min = 1, max = 45,message = "")
     private String town;
    @NotEmpty(message = "Please enter your Address.")
    @Size(min = 1, max = 65,message = "")
     private String address;
    @Digits(integer=2,fraction=0,message = "Please enter valid credit card number .")
     private Integer cardtype; 
@Pattern(regexp = "^[A-Za-z ,.'-]*$" , message = "Please enter valid name .")
     private String holdername;
    @NotEmpty(message = "Please enter your PostalCode.")
    @Size(min = 1, max = 25,message = "")
    @Pattern(regexp = "^[A-Za-z0-9]*$" , message = "Please enter Alphanumeric value.")
     private String postalCode;
    @Pattern(regexp = "^[0-9]*$" ,message = "Please enter valid credit card number .")
     private String cardnumber;
     private String result;
     private int balance;

    public int getBalance() {
        return balance;
    }

    public void setBalance(int balance) {
        this.balance = balance;
    }
     private Integer id;
  
    public Integer getId() {
        return id;
    }
      public void setId(Integer id) {
        this.id = id;
    }
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
    
     public String getResult() {
        return result;
    }

     public void setResult(String result) {
        this.result = result;
    }
    
     public String getcardnumber() {
        return cardnumber;
    }
  
    public void setcardnumber(String cardnumber) {
        this.cardnumber = cardnumber;
    }
    
    public Integer getcardtype() {
        return cardtype;
    }

    public void setcardtype(Integer cardtype) {
        this.cardtype = cardtype;
    }
    
    public String getaddress() {
        return address;
    }

    public void setaddress(String address) {
        this.address = address;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getTown() {
        return town;
    }

    public void setTown(String town) {
        this.town = town;
    }
    

    public String getPostalCode() {
        return postalCode;
    }

    public void setPostalCode(String postalCode) {
        this.postalCode = postalCode;
    }
   
public String getholdername() {
        return holdername;
    }

    public void setholdername(String holdername) {
        this.holdername = holdername;
    }

    public void setUsername(String string) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
            
}
